// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_REP_REPLACE_PRODUCT
// * CreateDate    : 2012-1-9 20:49:36
// * Creater       : CodeSmith
// * LastChangeDate: 2012-1-9 20:49:36
// * LastChanger   : 2012-1-9 20:49:36
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class RepReplaceProductEntity : EntityBase
    {
        public RepReplaceProductTable TableSchema
        {
            get
            {
                return RepReplaceProductTable.Current;
            }
        }

        public RepReplaceProductEntity()
        {

        }

        public RepReplaceProductEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ReplaceProductId = Convert.ToString(CommonFunctions.ToObject(dr["REPLACE_PRODUCT_ID"]));
            this.CheckInfoItemId = Convert.ToString(CommonFunctions.ToObject(dr["CHECK_INFO_ITEM_ID"]));
            this.MaterialProductId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_PRODUCT_ID"]));
            this.UnitQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_QTY"]));
            this.TotalQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_QTY"]));
            this.UnitPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_PRICE"]));
            this.TotalPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_PRICE"]));
            this.RepairFunction = Convert.ToString(CommonFunctions.ToObject(dr["REPAIR_FUNCTION"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public RepReplaceProductEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ReplaceProductId = Convert.ToString(CommonFunctions.ToObject(dr["REPLACE_PRODUCT_ID"]));
            this.CheckInfoItemId = Convert.ToString(CommonFunctions.ToObject(dr["CHECK_INFO_ITEM_ID"]));
            this.MaterialProductId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_PRODUCT_ID"]));
            this.UnitQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_QTY"]));
            this.TotalQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_QTY"]));
            this.UnitPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_PRICE"]));
            this.TotalPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["TOTAL_PRICE"]));
            this.RepairFunction = Convert.ToString(CommonFunctions.ToObject(dr["REPAIR_FUNCTION"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return RepReplaceProductTable.Current;
            }
        }

        #region Perporty List
        public string ReplaceProductId
        {
            get { return Convert.ToString(GetData(RepReplaceProductTable.C_REPLACE_PRODUCT_ID)); }
            set { SetData(RepReplaceProductTable.C_REPLACE_PRODUCT_ID, value); }
        }

        public string CheckInfoItemId
        {
            get { return Convert.ToString(GetData(RepReplaceProductTable.C_CHECK_INFO_ITEM_ID)); }
            set { SetData(RepReplaceProductTable.C_CHECK_INFO_ITEM_ID, value); }
        }

        public string MaterialProductId
        {
            get { return Convert.ToString(GetData(RepReplaceProductTable.C_MATERIAL_PRODUCT_ID)); }
            set { SetData(RepReplaceProductTable.C_MATERIAL_PRODUCT_ID, value); }
        }

        public decimal UnitQty
        {
            get { return Convert.ToDecimal(GetData(RepReplaceProductTable.C_UNIT_QTY)); }
            set { SetData(RepReplaceProductTable.C_UNIT_QTY, value); }
        }

        public decimal TotalQty
        {
            get { return Convert.ToDecimal(GetData(RepReplaceProductTable.C_TOTAL_QTY)); }
            set { SetData(RepReplaceProductTable.C_TOTAL_QTY, value); }
        }

        public decimal UnitPrice
        {
            get { return Convert.ToDecimal(GetData(RepReplaceProductTable.C_UNIT_PRICE)); }
            set { SetData(RepReplaceProductTable.C_UNIT_PRICE, value); }
        }

        public decimal TotalPrice
        {
            get { return Convert.ToDecimal(GetData(RepReplaceProductTable.C_TOTAL_PRICE)); }
            set { SetData(RepReplaceProductTable.C_TOTAL_PRICE, value); }
        }

        public string RepairFunction
        {
            get { return Convert.ToString(GetData(RepReplaceProductTable.C_REPAIR_FUNCTION)); }
            set { SetData(RepReplaceProductTable.C_REPAIR_FUNCTION, value); }
        }

        public string Remark
        {
            get { return Convert.ToString(GetData(RepReplaceProductTable.C_REMARK)); }
            set { SetData(RepReplaceProductTable.C_REMARK, value); }
        }

        #endregion
    }


}

